/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("goods_request",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using LDR.ShenPi.IServices;
using VOL.Core.Filters;

namespace LDR.ShenPi.Controllers
{
    public partial class goods_requestController
    {
        private readonly Igoods_requestService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public goods_requestController(
            Igoods_requestService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
        [ApiActionPermission("goods_request", VOL.Core.Enums.ActionPermissionOptions.Search)]
        [HttpGet("DaiShenPi")]
        public IActionResult Dai()
        { 
            var list=_service.GetDai();
            return Ok(list);
        }
        [ApiActionPermission("goods_request", VOL.Core.Enums.ActionPermissionOptions.Search)]
        [HttpGet("YiShenPi")]
        public IActionResult Yi()
        { 
            var list=_service.GetYi();
            return Ok(list);
        }
        [ApiActionPermission("goods_request", VOL.Core.Enums.ActionPermissionOptions.Search)]
        [HttpGet("TongYi")]
        public IActionResult tong(int id)
        {
            var count = _service.UpdSuccess(id);
            return Ok(count);
        }
        [ApiActionPermission("goods_request", VOL.Core.Enums.ActionPermissionOptions.Search)]
        [HttpGet("JuJue")]
        public IActionResult ju(int id)
        {
            var count = _service.UpdDanger(id);
            return Ok(count);
        }
    }
}
